/**
 */
import { Base64 } from 'js-base64'

export const filePerviewMixin = {
  data() {
    return {}
  },
  mounted() {
  },
  created() {
  },
  computed: {},
  methods: {
    
    OnPerview(record) {
      let fileUrl = `${window._CONFIG['onlinePreviewFileURL']}/sys/common/static/${record.fileUrl}`
      // let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileUrl)}`
      let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileUrl))}`
      window.open(url, '_blank')
    },
    OnDownLoad(record) {
      this.$message.success('正在下载，请稍等！')
      let url = `${window._CONFIG['domianURL']}/sys/common/static/${record.fileUrl}`
      window.open(url, '_blank')
    }
  }
}